/*
 * DateParameter.java July 2009
 *
 * Copyright (C) 2009, Quirino Zagarese <quirino@laszloitalia.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  USA
 */
package org.eu4ria.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;



/**
 * This lets you specify if a Date argument should be constrained to a range.
 * By default, each {@link Action} annotated method will costraint its Date arguments to the
 * [1970-01-01 to 2099-12-31] range.
 *
 * <pre>
 * [at]Action
 * public void setNewDate(
 * 	[at]DateParameter(minvalue="2008-10-1", maxvalue="2400-12-31")Date newDate){
 * 	this.date = newDate;
 * }
 * </pre>
 *
 * @author Quirino Zagarese
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface DateParameter {

	/**
	 * The lowest allowed value.
	 *
	 *
	 */
	public String minvalue() default "1970-01-01";

	/**
	 * The highest allowed value.
	 *
	 *
	 */
	public String maxvalue() default "2099-12-31";

	/**
	 * Indicates if minvalue is included in the range.
	 *
	 *
	 */
	public boolean includeMin() default true;

	/**
	 * Indicates if maxvalue is included in the range.
	 *
	 *
	 */
	public boolean includeMax() default true;

}
